<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>자바 표준 태그 라이브러리:JSTL</title>
</head>
<body>
	<h1>자바 표준 태그 라이브러리:JSTL</h1>
	<h3>sql:데이터베이스 처리</h3>
	<p>sql:setDataSource:데이터베이스 접속정보를 datasource로 작성</p>
	<p>sql:query:실행할 sql 질의문을 정의,매개변수된 입력값도 정의가능</p>
	<p>sql:param:매개변수화된 입력값에 실제 값을 대입하기 위해 사용</p>
	<p>sql:update:insert,update,delete 질의 정의시 사용</p>
	
	<sql:setDataSource var="myDS" 
	driver="oracle.jdbc.driver.OracleDriver" 
	url="jdbc:oracle:thin:@112.216.253.122:1521:XE"
	user="dds889" password="dds889"/>
	
	<c:set var="myUID" value="bb"/>
	
	<%-- <sql:query var="rs" dataSource="${myDS}">--%>
	<sql:query var="rs" dataSource="jdbc/oracle11xe">
	select * from member where userid=?
	<sql:param value="${myUID}"/>
	</sql:query>
	
	<c:forEach var="r" items="${rs.rows}">
		${r.userid}/${r.passwd}/${r.regdate}
	</c:forEach>
</body>
</html>
